From 54ec3cccf506ce9704d45ec6f7267e084bcd1493 Mon Sep 17 00:00:00 2001 From: Aidan Hobson Sayers Date: Wed, 27 Apr 2016 15:54:58 +0100 Subject: [PATCH] `path` dependencies are ignored from crates.io --- src/doc/guide.md | 9 +++++++++ src/doc/manifest.md | 3 +++ 2 files changed, 12 insertions(+) diff --git a/src/doc/guide.md b/src/doc/guide.md index 80f750847..e305aab5c 100644 --- a/src/doc/guide.md +++ b/src/doc/guide.md @@ -446,6 +446,15 @@ in the `hello_utils` folder (relative to the `Cargo.toml` it’s written in). And that’s it! The next `cargo build` will automatically build `hello_utils` and all of its own dependencies, and others can also start using the crate as well. +However, dependencies with only a path are not permitted on crates.io so if we +wanted to publish our `hello_world` crate we would need to publish a version of +`hello_utils` to crates.io (or specify a git repository location) and specify it +in the dependencies line: + +```toml +[dependencies] +hello_utils = { path = "hello_utils", version = "0.1.0" } +``` ## Travis-CI diff --git a/src/doc/manifest.md b/src/doc/manifest.md index fcf614d51..cbd3b0044 100644 --- a/src/doc/manifest.md +++ b/src/doc/manifest.md @@ -149,6 +149,9 @@ You can specify the source of a dependency in a few ways: inside it. The specified path should be relative to the current `Cargo.toml`. * If `path` and `git` are omitted, the dependency will come from crates.io, and the `version` key will be used to indicate the version requirement. +* `path` will be ignored for all dependencies retrieved from crates.io, so `git` + or `version` must be specified for all crate dependencies when uploading to + crates.io. Dependencies from crates.io can also use a shorthand where just the version requirement is specified: -- 2.30.2